package com.wisdytech.ccdserver.common.utils;

import com.alibaba.excel.metadata.CellData;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.style.column.AbstractColumnWidthStyleStrategy;
import org.apache.poi.ss.usermodel.Cell;

import java.util.List;

/**
 * Execl处理器，设置宽度
 *
 * @author zhd
 * @Title: ExecutorsUtil
 * @date 2024年5月22日10:53:05
 */

public class ExcelCustomHandler extends AbstractColumnWidthStyleStrategy {

    public ExcelCustomHandler() {

    }

    @Override
    protected void setColumnWidth(WriteSheetHolder writeSheetHolder, List<CellData> cellDataList, Cell cell, Head head, Integer relativeRowIndex, Boolean isHead) {
        writeSheetHolder.getSheet().setColumnWidth(cell.getColumnIndex(), 12 * 256);
    }
}
